home *** CD-ROM | disk | FTP | other *** search
- ******************************************************************
- * COPYRIGHT (C) 1986 by Donald Krantz and James Stanley
- * - Note: This is a real, live, actual, registered copyright,
- * and should be treated as such. This source code is from
- * the book "68000 Assembly Language", Krantz and Stanley,
- * Addison-Wesley Publishing Company, Reading, MA, 1986.
- *
- * Permission granted by the authors for non-commercial use
- * in programs released to the public domain, as long as this
- * copyright notice remains attached and visible.
- *
- * Graphics test
- #bit.h
-
- xref g_pix,g_clear,g_vector,g_mode,g_circle,g_fill
- xref creep,dump,arrow,snarl
- xdef image
-
- move.w #jam_m,d0
- bsr g_mode
- bsr g_clear * clear up screen
- ******* Draw distorted crosshatch *******************************
- move.w #0,d0 * set initial moving X
- move.w #vert-1,d3 * set initial moving Y
- lpx:
- clr.w d1 * set stationary Y
- clr.w d2 * set stationary X
- bsr g_vector * draw line
- move.w #vert-1,d1 * go across image for stationary
- move.w #hor_b-1,d2 * X and Y
- bsr g_vector * draw reflected line
- add.w #8,d0 * move the moving X
- sub.w #5,d3 * move the moving Y
- cmp.w #hor_b,d0 * check for limit
- blt lpx * loop if we aren't at limit
- ******* circle test - concentric circles ************************
- move.w #hor_b/2,d0 * center the circles in the image
- move.w #vert/2,d1
- move.w #5,d2 * start with a tiny radius
- move.w #1,d3 * this will be incrementer
- lpc:
- bsr g_circle * draw the circle
- add.w d3,d2 * double the radius
- addq.w #1,d3 * increment the incrementer
- cmp #75,d2 * check that we don't get too big
- blt lpc * if not, make more circles
- ******* fill in between two of the circles **********************
- move.w #65,d1 * pick Y to start creep
- bsr creep * do creep
- ******* mode check - set mode to complement for next tests ******
- move.w #comp_m,d0
- bsr g_mode
- ******* fill test ***********************************************
- move.w #0,d0 * make a vertical bar down the
- move.w #(vert/2-20),d1 * center
- move.w #hor_b-1,d2
- move.w #(vert/2+20),d3
- bsr g_fill
- move.w #(hor_b/2-5),d0 * make a horizontal bar across
- move.w #0,d1 * the center
- move.w #(hor_b/2+5),d2
- move.w #vert-1,d3
- bsr g_fill
- ******* Arrow icon test *****************************************
- move.w #jam_m,d0 * test first in jam mode
- bsr g_mode
- move.w #20,d0 * put way over on left
- move.w #(vert/2+15),d1 * and half on filled area
- bsr arrow * put arrow
- move.w #comp_m,d0 * next test complement mode
- bsr g_mode * set comp code
- move.w #35,d0 * put next arrow just right
- bsr arrow * put arrow
- move.w #set_m,d0 * next try set mode
- bsr g_mode * set set mode
- move.w #50,d0 * put next arrow just right
- bsr arrow * put arrow
- move.w #clr_m,d0 * last, try clear mode
- bsr g_mode * set clear mode
- move.w #65,d0 * put last arrow to the right
- bsr arrow * put arrow
- ******* Snarl icon test *****************************************
- move.w #jam_m,d0 * reset to jam mode
- bsr g_mode * set mode
- move.w #278,d0 * put way over on right
- move.w #10,d1 * and down a little from top
- bsr snarl * put snarl icon
- ******* now we dump our picture to the printer ******************
- bsr dump
- rts
- *****************************************************************
- bss
- image:
- ds.b vert*hor_w * This is the global image memory
-
- end